<template>
  <div class="son2">
    子组件2
    <br>
    {{ count }}
    <br>
    <button @click="funRedOne(1)">n-1</button>
    <button @click="changeOne(2222)">1s后变为2222</button>
    <br>
    {{ filter }}
  </div>
</template>

<script>
import {mapState,mapMutations,mapActions,mapGetters} from 'vuex'
export default {
    name:'MySon2',
    computed:{
        ...mapState(['count']),
        ...mapGetters(['filter'])
    },
    methods:{
        ...mapMutations(['funRedOne']),
        ...mapActions(['changeOne'])
    }
}
</script>

<style>
.son2 {
    border: 3px solid black;
    width: 400px;
}
</style>